package com.myboxlab.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;

import com.myboxlab.common.util.BLView;

@Controller
@SessionAttributes
public class Handler {

    /**
     * 创建后台管理系统 模板页面
     */
    public BLView createAdminTempletResponse(String page) {
        return new BLView("/admin/include/tpl", page);
    }

    /**
     * 创建前台 模板页面
     */
    public BLView createAppsTempletResponse(String page) {
        return new BLView("/apps/include/tpl", page);
    }

    public ModelAndView request(BLView data) {
        return new ModelAndView(data.getTemplet() != null ? data.getTemplet() : data.getPage(),
                "data", data);
    }

}
